]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[ShellWindowTracker] Don't skip "uninteresting" windows for focus
authorColin Walters <walters@verbum.org>
Wed, 21 Oct 2009 15:28:07 +0000 (11:28 -0400)
committerColin Walters <walters@verbum.org>
Wed, 21 Oct 2009 15:30:13 +0000 (11:30 -0400)
For the purposes of determining which application is focused, don't
skip "uninteresting" windows.  The old get_focused_window code
was used for usage tracking, but here we want reliable application
association.

Also convert a .text= to .set_text that was missed with the last
patch.

https://bugzilla.gnome.org/show_bug.cgi?id=599206

js/ui/panel.js
src/shell-window-tracker.c

index 20251b5cadaa757e350807abe853099308fb57c0..447bb854e3e529cbb21e5a7a92a3a4927641570c 100644 (file)
@@ -146,7 +146,7 @@ AppPanelMenu.prototype = {
 
         this._iconBox.remove_all();
         this._iconBox.hide();
-        this._label.text = '';
+        this._label.set_text('');
         if (this._focusedApp != null) {
             let icon = this._focusedApp.create_icon_texture(PANEL_ICON_SIZE);
             this._iconBox.append(icon, Big.BoxPackFlags.NONE);
index a311a0f9c75cca7a2cdf7b7bfe5dbf6542c882a0..b0174d08a9f31e5b682b25795a7677bfb2706deb 100644 (file)
@@ -380,22 +380,6 @@ _shell_window_tracker_get_app_context (ShellWindowTracker *tracker, ShellApp *ap
   return "";
 }
 
-static MetaWindow *
-get_active_window (ShellWindowTracker *monitor)
-{
-  MetaScreen *screen;
-  MetaDisplay *display;
-  MetaWindow *window;
-
-  screen = shell_global_get_screen (shell_global_get ());
-  display = meta_screen_get_display (screen);
-  window = meta_display_get_focus_window (display);
-
-  if (window != NULL && shell_window_tracker_is_window_interesting (window))
-    return window;
-  return NULL;
-}
-
 static void
 on_transient_window_title_changed (MetaWindow      *window,
                                    GParamSpec      *spec,
@@ -687,13 +671,18 @@ shell_window_tracker_get_running_apps (ShellWindowTracker *monitor,
 static gboolean
 idle_handle_focus_change (gpointer data)
 {
+  MetaScreen *screen;
+  MetaDisplay *display;
   ShellWindowTracker *tracker = data;
   MetaWindow *new_focus_win;
   ShellApp *new_focus_app;
 
   tracker->idle_focus_change_id = 0;
 
-  new_focus_win = get_active_window (tracker);
+  screen = shell_global_get_screen (shell_global_get ());
+  display = meta_screen_get_display (screen);
+
+  new_focus_win = meta_display_get_focus_window (display);
   new_focus_app = new_focus_win ? g_hash_table_lookup (tracker->window_to_app, new_focus_win) : NULL;
 
   if (new_focus_app == tracker->focus_app)